<?php 
	require_once ('checks.php');
	require_once ('Database.php'); 
	$db= new DB();								
	$arr=$db->takeGallery();
	$n=count($arr);
	echo " Моля изберете снимка която да съответства на  новината ";
	echo"<table border='1'>";
	echo "<tr>";
		for ($i=0;$i<$n;$i++){			
			echo "\n <td><a href='?page=".$_GET['references']."&image=".$arr[$i]->getName();
			if (isset($_GET['news_name'])) {
				echo "&news_name=".$_GET['news_name'];
			}
			echo "'><img src='images/gallery/".$arr[$i]->getName()."' width='80' height='80'></a><br/>".$arr[$i]->getDate()."</td>";
			if (($i+1) % 10 == 0 && ($i+1)!=$n ) echo "\n</tr>\n<tr>\n";
		}
	echo "</tr>";
	echo "</table>";
?>